<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div></div>
    <p></p>
    <button class="start">
        开始
    </button>
    <button class="stop">暂停</button>
    <script>
        let box = document.querySelector('div'),
            start = document.querySelector('.start'),
            stop = document.querySelector('.stop'),
            p = document.querySelector('p'),
            i = 0, time, name = ['zwc', 'hjy', 'lq', 'gz', 'lzw', 'fys', 'wc'];
        start.onclick = x => time = setInterval(x => box.innerHTML = name[Math.round(Math.random() * (name.length - 1))], 10);
        stop.onclick = x => {
            clearInterval(time);
            i++;
            p.innerHTML += '第' + i + '次:' + ' ' + box.innerHTML + '</br>';
        };
    </script>
</body>
<style>
    * {
        padding: 0;
        margin: 30px;
    }

    div {
        height: 100px;
        width: 100px;
    }
</style>

</html>